import React, { Component } from 'react'
import "./Header.less"
import { withRouter } from 'react-router-dom'

function Header(props){
    let {title,back,history:{goBack}} = props;

    return (
        <div className="header">
            {
                back ? <span className="header-back" onClick={()=>goBack()}>返回</span> : null
            }
            <h3 className="header-title">{title}</h3>
        </div>
    )
}
export default withRouter(Header)
